<!DOCTYPE html>
<html>
	{include file="public/header" /}

	<body>
		<div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">

			<div class="layui-form-item">
				<label class="layui-form-label">订单号</label>
				<div class="layui-input-inline">
					<input type="text" name="OrderSn" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="{$data.OrderSn}">
				</div>
			</div>
		    <div class="layui-form-item">
				<label class="layui-form-label">订单应还</label>
				<div class="layui-input-inline">
					到账金额+服务费+逾期费
					<input type="text" name="dingdan_yinghuan_money" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="{$data.dingdan_yinghuan_money}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">目前应还</label>
				<div class="layui-input-inline">
					订单应还-部分还款-豁免
					<input type="text" name="muqian_yinghuan_money" id="muqian_yinghuan_money" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="{$data.muqian_yinghuan_money}">
				
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">逾期费</label>
				<div class="layui-input-inline">
					<input disabled="disabled" type="text" name="yuqimoney" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="{$data.yuqimoney}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">本次还款金额</label>
				<div class="layui-input-inline">
					<input type="text" name="moneyshiji" id="money_caozuo" lay-verify="required" placeholder="请输入实际还款金额" autocomplete="off" class="layui-input" value="">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">剩余应还金额</label>
				<div class="layui-input-inline">
					目前应还-本次还款金额
					<input type="text" name="moneysheng" id="moneysheng" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="" disabled="disabled">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">收款方式</label>
				<div class="layui-input-inline">
					<select name="pay">
						<option value="6" selected="selected">线上银行</option>
						
					</select>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">还款类型</label>
				<div class="layui-input-inline">
					<select name="Type">
						<option value="1" selected="selected">部分还款</option>
						
					</select>
				</div>
			</div>
			<input type="hidden" name="ID" lay-verify="required" placeholder="隐藏域 编辑用户ID" autocomplete="off" class="layui-input" value="{$data.ID}">
			<div class="layui-form-item layui-hide">
				<button class="layui-btn" lay-submit lay-filter="LAY-user-back-submit" id="LAY-user-back-submit">提交</button>
			</div>
		</div>
		{include file="public/footer" /}
		<script>
			layui.use(['form'], function() {
				var $ = layui.$,
					form = layui.form;
			})
			$("#money_caozuo").change(function() {
				var muqian_yinghuan_money = $("#muqian_yinghuan_money").val();
				var money_caozuo = $(this).val();
				if(money_caozuo<0){
					alert('请输入正确的金额');
				}

				var moneysheng = muqian_yinghuan_money - money_caozuo;
				
				if(moneysheng<0){
					alert('请输入正确的金额');
					
				}else{
					
					$("#moneysheng").val(moneysheng);
				}


			})
		</script>
	</body>

</html>